/**
 * @class ST2Demo.proxy.Twitter
 * @extends Ext.data.proxy.JsonP
 *
 * This simple proxy allows us to use Twitter's JSON-P API to search for tweets. All we're really doing in this
 * class is setting a few defaults (such as the number of tweets per page and a simple JSON Reader)
 *
 */
Ext.define('ST2Demo.proxy.Twitter', {
    extend: 'Ext.data.proxy.JsonP',
    alias: 'proxy.twitter',
    
    config: {
        // This is the url we always query when searching for tweets
        url: 'http://search.twitter.com/search.json',
        
        extraParams: {
            result_type: 'mixed', // Returns popular tweets at the top of the result
            lang: 'en',           // Only show English results
            q: 'sencha'           // Search term
        },

        reader: {
            type: 'json',
            rootProperty: 'results'
        }
    }
});